<meta charset="UTF-8">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h3 class="modal-title">操作</h3>
			</div>
			<div class="modal-body" style="height: 300px;">
				<form class="form-horizontal" id="myForm">
					<input type="hidden" name="id" data-th-value="${user.id}">
					<div class="form-group">
						<label for="" class="col-md-3 control-label">姓名</label>
						<div class="col-md-7">
							<input type="text" name="name" class="form-control" data-th-value="${user.name}"  placeholder="请输入姓名"/>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-md-3 control-label">用户名</label>
						<div class="col-md-7">
							<input type="text" name="username" class="form-control" data-th-value="${user.username}" placeholder="请输入用户名"/>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-md-3 control-label">年龄</label>
						<div class="col-md-7">
							<input type="text" name="age" class="form-control"  data-th-value="${user.age}" placeholder="请输入年龄"/>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-md-3 control-label">性别</label>
						<div class="col-md-7">
							<select class="form-control" name="sex" id="sex">
								<option style="display: none;"></option>
								<option th:value="男" th:selected="${user}" data-if-text="${user.sex=='男'}">男</option>
								<option th:value="女" th:selected="${user}" data-if-text="${user.sex=='女'}">女</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-md-3 control-label">电话</label>
						<div class="col-md-7">
							<input type="text"name="phone" class="form-control" data-th-value="${user.phone}" placeholder="请输入电话号"/>
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-md-3 control-label">备注</label>
						<div class="col-md-7">
							<input type="text" name="ranmek" class="form-control" data-th-value="${user.ranmek}" placeholder="请输入备注"/>
						</div>
					</div>
				</form>
			</div>
		
	
		<br>
		<div class="modal-footer">
			<button type="button" class="btn btn-success" data-dismiss="modal" id="g_formButton">
				<span class="glyphicon glyphicon-ok"></span> 提交申请
			</button>
			<button type="button" class="btn btn-danger" data-dismiss="modal">
				<span class="glyphicon glyphicon-remove"></span> 关闭
			</button>
		</div>
	</div>
</div>
<script>
	$(function(){
		/* $("#sex option[value='${user.sex}']").attr('selected',true) */
		$('#g_formButton').click(function(){
			var serial= $("#myForm").serialize();
			$.ajax({
				url:'user/save',
				type:'post',
				data:serial,
				success:function(data){
					$('#mytab') .bootstrapTable('refresh');
					bootbox.alert('<h4>'+data.msg+'</h4>');
				}
			});
		});
	});
</script>